package com.zrz.service;

import com.zrz.resp.WechatOpenIdResp;
import com.zrz.vo.OpenIdVo;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.UUID;
@Service
public class UserService {
    @Autowired
    private WechatService wechatService;
    public Object onLogin(String code) {

        WechatOpenIdResp resp = wechatService.getOpenId(code);

        String token = UUID.randomUUID().toString().replaceAll("-", "");
        OpenIdVo response = new OpenIdVo();
        BeanUtils.copyProperties(resp, response);
        return response;
    }
}
